<template name="goodsAre">
	<view class="display flow goodsAre">
		<view class="display column goodsItemAre borderR" v-for="(item,index) in goodsList" :key="index" @click="goodsClick(item.id)">
			<!-- <image :src="item.head_img" mode=""></image> -->
			<view class="imgAre">
				<image :src="item.head_img"></image>
				<view class="earnings" v-if="goodsType != 'fxShop' && Number(item.one_fx_price)">
					<text>分享收益 {{item.one_fx_price}} 元</text>
				</view>
			</view>
			<view class="display column goodsItem">
				<view class="display column item">
					<text class="fontHide2">{{item.product_name}}</text>
					<text class="goodsSubName pColor fontHide" v-if="item.title">{{item.title}}</text>
				</view>
				<!-- <view class="earnings borderR" v-if="goodsType != 'fxShop'">
					<text>分享收益{{item.one_fx_price}}元</text>
				</view> -->
				<view class="display flow priceAre" style="margin: 20rpx 0 0;">
					<text class="price">￥{{item.price}}</text>
					<text class="pColor" v-if="goodsType != 'fxShop' && item.old_price && item.old_price > item.price">￥{{item.old_price}}</text>
				</view>
				<!-- <text class="pColor" v-if="goodsType != 'fxShop'">销量：{{item.buy_num}}</text> -->
				<!-- <view class="display flow itemAre">
					
					<image src="/static/images/icon/carG.png" class="carImg" v-if="goodsType=='class'|| goodsType=='car'"></image> -->
					<!-- <uni-icons :type="'plus-filled'" :color="'red'" v-if="goodsType=='shop'" size="25" />
				</view> -->
			</view>
		</view>
		<uni-popup ref="showtip" :mask-click="false" :type="popType" @change="change">
			<loginPop class="pop" @cancel="cancel"></loginPop>
		</uni-popup>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	import loginPop from '@/components/loginPop.vue'
	export default {
		name:'goodsAre',
		components: {loginPop},
		data() {
			return {
				popType: ''
			}
		},
		props: ['goodsList','goodsType'],
		computed: {
			...mapState(['hasLogin'])
		},
		methods:{
			goodsClick(id){
				this.$emit('goodsClick',id)
			},
			togglePopup(type,open) {
				this.popType = type
				this.$nextTick(() => {
					this.$refs['show' + open].open()
				})
			},
			cancel(type){
				this.$refs['show' + type].close()
			},
			change(e) {
				console.log('是否打开:' + e.show)
			},
		}
	}
</script>

<style scoped lang="scss">
	@import '@/common/css/goodsAre.scss';
	.goodsItem{
		@include width(330rpx);
		.item{
			max-height: 120rpx;
		}
		.goodsSubName{
			@include margin(10rpx,'top');
		}
		.pColor{
			@include font($fontSize - 4rpx);
		}
	}
</style>
